package com.gpt.article.service.impl.taskHandle;

import chatgpt.ChatGPT;
import com.gpt.article.service.impl.taskHandle.task.XiGaoTasker;
import com.ruoyi.common.config.RuoYiConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class GenCompiesTmp extends GenTask{


//    private static Logger logger = LoggerFactory.getLogger(GenCompiesTmp.class);
//
//
//    private Long taskId;
//    private ChatGPT chatGPT;
//    private GenTask genTask;
//
//
//    public Integer createCompiesTmp(Long taskId, String acc , List<String> compiesTmps){
//        this.taskId = taskId;
//        int genNum = 1;
//
//        try {
//            chatGPT = ChatGPT.builder()
//                    .apiKey(RuoYiConfig.getApiKeys())
//                    .timeout(9000)
//                    .apiHost(RuoYiConfig.getGptApiHost()) //代理地址
//                    .build()
//                    .init();
//        }catch (Exception e){
//            logger.error("丢包或者请求异常重试:{}",e.getMessage());
//        }
//        Map<String,Object> map = new HashMap<String,Object>();
//        chatGPT = new GptRequstHelper().getGpt(chatGPT);
//
//        genTask = new GenTask.Builder()
//                .setTaskNum(genNum)
//                .setAcc(acc)
//                .setThreadCount(Integer.valueOf(RuoYiConfig.getGenThreadCount()))
//                .setGenType("topic")
////                .setGptFunPrompts(gptFunPrompts)
////                .setRefer(refer)
////                .addArticleList(articles)
//                .setchatGpt(chatGPT)
////                .setOneToNum(oneToNum)
////                .setUseModel(ChatCompletion.Model.GPT_3_5_TURBO_0613.getName())
//                .addPsMap()
//                .addTopicTask(compiesTmps)
////                .setTxtlength(txtlength)
////                .setTuswitch(tuswitch)
////                .setXituSwitch(xituSwitch)
//                .build();
//        genTask.start(true,"topic");
////        logger.info("文案创建任务结束：{}");
//        new XiGaoTasker().upTask(taskId,0,0,genNum,"2");
////        WebSocketUsers.sendMessageToUsersByText("end");
//        return  genNum;
//    }



}
